﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AssemblyExplorer;
using System.Windows.Forms;

namespace DescriptionStrategyPlugin
{
    public class DescriptionPlugin42 : IDescriptionPlugin
    {
        private DescrCustomFormatting _descr = new DescrCustomFormatting();
        private FormatControl _control = new FormatControl();

        public DescriptionPlugin42()
        {
            _control.FormatString = _descr.FormatString;
        }

        public IDescriptionStrategy DescriptionStrategy
        {
            get { return _descr; }
        }

        public bool HasOptionsPage
        {
            get { return true; }
        }

        public string Name
        {
            get { return "CustomFormatting"; }
        }

        public Control OptionsPage
        {
            get { return _control; }
        }

        public void ApplyOptions()
        {
            _descr.FormatString = _control.FormatString;
        }

        public string GetState()
        {
            return _descr.FormatString;
        }

        public void LoadState(string state)
        {
            _descr.FormatString = state;
            _control.FormatString = state;
        }
    }
}
